package org.demo.net;

import java.io.IOException;
import java.net.InetSocketAddress;
import java.net.Socket;

/**
 * 
 * @author  
 * @date    2010-10-20
 * @file    org.demo.net.Ping.java
 */
public class Ping {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// ip
		String ip = "10.0.1.12";
		// 端口
		int port = 1521;   
		// 5 秒
		int timeout = 5000; 
		
		InetSocketAddress endpoint = new InetSocketAddress(ip, port);
		Socket socket = new Socket();
		try {
			socket.connect(endpoint, timeout);
			System.out.println("connect to " + ip + " success.");
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
	
	
}
